import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        redirect: "/index"
    },
    {
        path: '/index',
        name: 'Index',
        component: () => import('../views/Index.vue')
    },
    {
        path: '/businessList/:typeId',
        name: 'BusinessList',
        component: () => import('../views/BusinessList.vue')
    },

    {
        path: '/businessInfo/:businessId',
        name: 'BusinessInfo',
        component: () => import('../views/BusinessInfo.vue')
    },
    {
        path: '/payment/:cartTotal',
        name: 'Payment',
        component: () => import('../views/Payment.vue')
    },
    {
        path: '/order',
        name: 'Order',
        component: () => import('../views/Order.vue')
    },
    {
        path: '/my',
        name: 'MyUser',
        component: () => import('../views/MyUser.vue')
    },
    {
        path: '/login',
        name: 'Login',
        component: () => import('../views/Login.vue')
    },
    {
        path: '/register',
        name: '/Register',
        component: () => import('../views/Register.vue')
    },

]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router
